import React from 'react'
import './controlfly.less'
import { getImage } from '@/utils/getImg'

const ControlFly = ({ changeView, setPlayPause }) => {
  const [isplay, setIsPlay] = React.useState(true)

  const playPause = () => {
    setPlayPause(isplay)
    setIsPlay(!isplay)
  }
  return (
    <>
      <div className="contro-fly-bottom">
        <div className="btn" title="切换视角">
          <img
            src={getImage('/wrj/视角切换.png')}
            onClick={changeView}
            alt=""
          />
        </div>
        <div className="btn" title={isplay ? '暂停' : '播放'}>
          <img
            src={getImage(`/wrj/${isplay ? '暂停' : '播放'}.png`)}
            onClick={playPause}
            alt=""
          />
        </div>
      </div>
    </>
  )
}

export default ControlFly
